Skip to content

Refactor webshop product labels#2005

Merged
tykling merged 2 commits intobornhack:mainfrom
0xUnicorn:refactor/webshop-product-labels
Feb 8, 2026
Merged

Refactor webshop product labels#2005
tykling merged 2 commits intobornhack:mainfrom
0xUnicorn:refactor/webshop-product-labels

Conversation

@0xUnicorn
Copy link
Contributor

Business logic for product labels has been moved from shop_index.html template to a Product model property, with tests.

Template now loads a default label template using a custom template tag for mapping label_type to css class.

I also changed the product labels to bootstrap badges

image

I started this refactoring with the goal of fixing #1985, so do we wanna change the logic for when we show any labels?

Refactor the logic for applying labels to a model property with test.
- Use templatetag for mapping 'label_type' to a css class
@0xUnicorn 0xUnicorn marked this pull request as ready for review February 6, 2026 21:51
@0xUnicorn 0xUnicorn changed the title WIP: Refactor webshop product labels Refactor webshop product labels Feb 6, 2026
@tykling
Copy link
Member

tykling commented Feb 8, 2026

very nice

@tykling tykling merged commit 96756b7 into bornhack:main Feb 8, 2026
1 of 2 checks passed
@0xUnicorn 0xUnicorn deleted the refactor/webshop-product-labels branch February 8, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webshop not showing 'sale ends in X days' for all items with end date

2 participants